<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>京东(JD.COM)-综合网购首选-正品低价、品质保障、配送及时、轻松购物！</title>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="css/normalize.css" />
    <link rel="stylesheet" href="css/base.css" />
    <link rel="stylesheet" href="css/cart.css">
    <script src="js/jquery.min.js"></script>
    <script src="js/base.js"></script>
    <script src="js/cart.js"></script>
    <script src="js/axios.min.js"></script>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <!-- import JavaScript -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<style>
    .my-content {
        width: 300px;
        height: 60px;
        font-weight: bolder;
        color: black;
        overflow: hidden;
        -webkit-line-clamp: 2;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
    }

    .my-font {
        font-weight: bolder;
        color: black;
        height: 60px;
    }

    .my-price {
        color: rgb(211, 10, 10);
    }

    .my-operation {
        width: 130px;
        text-align: center;
    }

    .my-status {
        width: 50px;
    }

    a {
        cursor: pointer;
    }
</style>

<body>
    <div id="app">
        <header>
            <a href="#">
                <img src="images/header.jpg" height="80" width="100%" alt="">
            </a>
        </header>
        <div>
            <iframe MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no src="heade.html"
                height="30px" width="100%"></iframe>
        </div>
        <div class="m">
            <div class="w middle">
                <div class="logo">
                    <h1>
                        <!-- 提高权重 便利于搜索引擎优化 -->
                        <a href="index.html" title="京东">京东</a>
                    </h1>
                </div>
                <div class="form">
                    <input id="text" type="text" placeholder="扫描仪">
                    <button><i></i></button>
                </div>
                <div class="shopCar">
                    <i></i><a href="cart.html" class="f10">我的购物车</a><span>8</span>
                </div>
                <div class="hotwords">
                    <a href="#" class="f10">199减100</a>
                    <a href="#">鼠标试用</a>
                    <a href="#">农资7折</a>
                    <a href="#">低至29元</a>
                    <a href="#">抽奖赢空调</a>
                    <a href="#">记忆棉</a>
                    <a href="#">坐垫</a>
                    <a href="#">1分钱买油</a>
                    <a href="#">智能手表</a>
                </div>
                <div class="navitems">
                    <ul>
                        <li><a href="list.html">秒杀</a></li>
                        <li><a href="#">优惠券</a></li>
                        <li><a href="#">闪购</a></li>
                        <li><a href="#">拍卖</a></li>
                        <li class="space "></li>
                        <li><a href="#">服装城</a></li>
                        <li><a href="#">京东超市</a></li>
                        <li><a href="#">生鲜</a></li>
                        <li><a href="#">全球购</a></li>
                        <li class="space"></li>
                        <li><a href="#">京东金融</a></li>
                    </ul>
                </div>
                <div class="super">
                    <a href="#"><img src="images/super.png" alt=""></a>
                </div>
            </div>
        </div>
        <div class="py-container">
            <div class="w">
                <div class="allgoods">
                    <h4>全部商品订单
                        <span></span>
                    </h4>
                    <div class="cart-main">


                        <div class="cart-item-list">
                            <div class="cart-body">
                                <div class="cart-list">
                                    <!-- <ul class="goods-list yui3-g" v-for='orderVo in commodityList'> -->
                                    <el-descriptions style="margin-top: 50px;" class="margin-top" :column="7" border
                                        v-for='(orderInfo,index) in orderInfoList' :title="orderInfo.createTime">
                                        <el-descriptions-item content-class-name="my-font" label="收货人">
                                            {{orderInfo.param.consigneeInfo.name}}</el-descriptions-item>
                                        <el-descriptions-item content-class-name="my-font" label="收货地址">
                                            {{orderInfo.param.consigneeInfo.address}}</el-descriptions-item>
                                        <el-descriptions-item content-class-name="my-price" label="总金额">
                                            {{orderInfo.price}}
                                        </el-descriptions-item>
                                        <el-descriptions-item label="商品信息">
                                            <img :src='orderInfo.param.commodityList[0].commodityInfo.exhibition'
                                                width="30px" />
                                        </el-descriptions-item>
                                        <el-descriptions-item label="名称" content-class-name="my-content">
                                            {{orderInfo.param.commodityList[0].commodityInfo.exName}}
                                        </el-descriptions-item>
                                        <el-descriptions-item label="状态" content-class-name="my-status">
                                            <el-tag v-if='orderInfo.orderStatus == 0'
                                                style="background-color:rgb(163, 4, 4);color: white;">未支付</el-tag>
                                            <el-tag v-if='orderInfo.orderStatus == 1'
                                                style="background-color:rgb(6, 170, 0);color: white;">已支付</el-tag>
                                            <el-tag v-if='orderInfo.orderStatus == 2'
                                                style="background-color: #ffd161;color: rgb(255, 255, 255);">已完成
                                            </el-tag>
                                            <el-tag v-if='orderInfo.orderStatus == 3'
                                                style="background-color: rgb(155, 121, 9);color: rgb(238, 231, 231);">
                                                退款中
                                            </el-tag>
                                            <el-tag v-if='orderInfo.orderStatus == -1'
                                                style="background-color: rgb(161, 160, 160);color: rgb(255, 255, 255);">
                                                已取消
                                            </el-tag>



                                        </el-descriptions-item>
                                        <el-descriptions-item label="操作" content-class-name="my-operation">
                                            <a>删除订单</a>
                                            <a @click='gotoPay(orderInfo.id)'
                                                style="margin-left: 10px;color: #000;">查看详情</a>
                                        </el-descriptions-item>
                                    </el-descriptions>

                                </div>



                            </div>


                        </div>
                    </div>
                    <el-pagination background @current-change="getPage" :current-page.sync="page" :page-size="limit"
                        layout="prev, pager, next, jumper" :total="total">
                    </el-pagination>

                </div>
            </div>
        </div>
        <footer>
            <div class="service">
                <!-- 服务模块 -->
                <div class="w">
                    <ul>
                        <li>
                            <h5></h5>
                            <p>品类齐全，轻松购物</p>
                        </li>
                        <li>
                            <h5></h5>
                            <p>品类齐全，轻松购物</p>
                        </li>
                        <li>
                            <h5></h5>
                            <p>品类齐全，轻松购物</p>
                        </li>
                        <li>
                            <h5></h5>
                            <p>品类齐全，轻松购物</p>
                        </li>
                    </ul>
                </div>
            </div>
            <!-- 帮助模块 -->
            <div class="w help">
                <div class="fl">
                    <dl>
                        <dt>购物指南</dt>
                        <dd><a href="#">购物流程</a></dd>
                        <dd><a href="#">会员介绍</a></dd>
                        <dd><a href="#">生活旅行</a></dd>
                        <dd><a href="#">常见问题</a></dd>
                        <dd><a href="#">大家电</a></dd>
                        <dd><a href="#">联系客服</a></dd>
                    </dl>
                    <dl>
                        <dt>配送方式</dt>
                        <dd><a href="#">上门自提</a></dd>
                        <dd><a href="#">211限时达</a></dd>
                        <dd><a href="#">配送服务查询</a></dd>
                        <dd><a href="#">配送费收取标准</a></dd>
                        <dd><a href="#">海外配送</a></dd>
                    </dl>
                    <dl>
                        <dt>支付方式</dt>
                        <dd><a href="#">货到付款</a></dd>
                        <dd><a href="#">在线支付</a></dd>
                        <dd><a href="#">分期付款</a></dd>
                        <dd><a href="#">邮局汇款</a></dd>
                        <dd><a href="#">公司转账</a></dd>
                    </dl>
                    <dl>
                        <dt>售后服务</dt>
                        <dd><a href="#">售后政策</a></dd>
                        <dd><a href="#">价格保护</a></dd>
                        <dd><a href="#">退款说明</a></dd>
                        <dd><a href="#">返修/退换货</a></dd>
                        <dd><a href="#">取消订单</a></dd>
                    </dl>
                    <dl>
                        <dt>特色服务</dt>
                        <dd><a href="#">夺宝岛</a></dd>
                        <dd><a href="#">DIY装机</a></dd>
                        <dd><a href="#">延保服务</a></dd>
                        <dd><a href="#">京东E卡</a></dd>
                        <dd><a href="#">京东通信</a></dd>
                        <dd><a href="#">京鱼座智能</a></dd>
                    </dl>
                </div>
                <div class="fr coverage">
                    <h5>京东自营覆盖区县</h5>
                    <p>京东已向全国2661个区县提供自营配送服务，支持货到付款、POS机刷卡和售后上门服务。</p>
                    <a href="#">查看详情 > </a>
                </div>
            </div>
            <div class="w copyright">
                <p>
                    <a href="#">关于我们</a>
                    <span> | </span>
                    <a href="#">联系我们</a>
                    <span> | </span>
                    <a href="#">联系客服</a>
                    <span> | </span>
                    <a href="#">合作招商</a>
                    <span> | </span>
                    <a href="#">商家帮助</a>
                    <span> | </span>
                    <a href="#">营销中心</a>
                    <span> | </span>
                    <a href="#">手机京东</a>
                    <span> | </span>
                    <a href="#">友情链接</a>
                    <span> | </span>
                    <a href="#">销售联盟</a>
                    <span> | </span>
                    <a href="#">京东社区</a>
                    <span> | </span>
                    <a href="#">风险监测</a>
                    <span> | </span>
                    <a href="#">隐私政策</a>
                    <span> | </span>
                    <a href="#">京东公益</a>
                    <span> | </span>
                    <a href="#">English Site</a>
                    <span> | </span>
                    <a href="#">Media & IR</a>
                </p>
                <div>
                    <p>京公网安备
                        11000002000088号<span>|</span>京ICP证070359号<span>|</span>互联网药品信息服务资格证编号(京)-经营性-2014-0008<span>|</span>新出发京零
                        字第大120007号</p>
                    <p>互联网出版许可证编号新出网证(京)字150号<span>|</span>出版物经营许可证<span>|</span>网络文化经营许可证京网文[2014]2148-348号<span>|</span>违法和不良信息举报电话：4006561155
                    </p>
                    <p>Copyright © 2004 - 2019 京东JD.com
                        版权所有<span>|</span>消费者维权热线：4006067733经营证照|(京)网械平台备字(2018)第00003号<span>|</span>营业执照</p>
                    <p>Global Site<span>|</span>Сайт России<span>|</span>Situs Indonesia<span>|</span>Sitio de
                        España<span>|</span>เว็บไซต์ประเทศไทย</p>
                    <p>京东旗下网站：京东钱包<span>|</span>京东云</p>
                </div>
                <p class="foot-icon">
                    <a href="#"></a>
                    <a href="#"></a>
                    <a href="#"></a>
                    <a href="#"></a>
                    <a href="#"></a>
                    <a href="#"></a>
                </p>
            </div>
        </footer>
    </div>
</body>


</html>

<script>
    new Vue({
        el: '#app',
        data() {
            return {
                token: '',//用户token
                orderInfoList: [],

                page: 1, // 当前页
                limit: 3, // 每页个数
                total: 1, // 总页码
                searchObj: {},
            }
        },
        created() {
            this.showInfo();
            this.getAllOrder();
        },
        methods: {
            showInfo() {
                let token = this.getCookie("token");
                if (token == "" || token == null) {
                    // window.location.href = 'login.html';
                } else {
                    this.token = token;
                }
            },
            getPage(page = 1) {
                this.page = page
                this.commodityList = []
                this.orderInfo = [];
                this.activeIndex = 0
                this.getAllOrder();
            },
            getAllOrder() {
                axios.post(`http://localhost/admin/order/getAllOrder/${this.page}/${this.limit}/${this.token}`, this.searchObj)
                    .then(response => {
                        let resData = response.data;
                        let orderInfoList = resData.data.records;
                        this.orderInfoList = orderInfoList;
                        this.total = resData.data.total;
                        console.log(this.orderInfoList)
                    })
            },
            gotoPay(orderId) {
                window.open('pay.html?orderId=' + orderId);
            },
            GetURLParameter(sParam) {
                let sPageURL = window.location.search.substring(1);
                let sURLVariables = sPageURL.split("&");
                for (let i = 0; i < sURLVariables.length; i++) {
                    let sParameterName = sURLVariables[i].split('=');
                    if (sParameterName[i] == sParam) {
                        return sParameterName[i + 1];
                    }
                }
            },
            getCookie(name) {
                var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
                if (arr = document.cookie.match(reg)) {
                    return unescape(arr[2]);

                } else {
                    return null;
                }
            },

        }
    })
</script>